perm filename SPLIT[1,ALS] blob sn#508606 filedate 1980-05-09 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002		CAILE	U3,INPMAX
C00004 ENDMK
CāŠ—;
	CAILE	U3,INPMAX
	JRST	DMPFIZ
	MOVE	U1,INPKNK
	JUMPE	U1,DMPFIN		;Are current records for king boards?
	TRNE	U3,1		;Are there a non-even number  of records?
	ADDI	U3,5		;yes, add an extra set
	JRST	DMPFIY
DMPFIN:	TRNE	U3,4		;Are there an odd number of sets of data
	ADDI	U3,4
DMPFIY:	LSH	U3,-1		;Divide by 2
	ADD	U2,U3
	HRRM	U2,BKMIN2	;Starting address for the second half
	MOVNS	U3		;to put into an IOWD
	HRLM	U3,BKMIN	;The negative of the number of words to dump
	HRLM	U3,BKMIN2	;The second half (may contain one empty set)
	MOVNS	U3		;for use below
	MOVEI	U2,INPA
	MOVEI	U1,[ASCIZ /DIVIDE OUTPUT FILE /]
	PUSHJ	PDP,PRINT
	PUSHJ	PDP,TERPRI
	SETZ	U2
	SKIPE	INDEXA(U2)
	AOJA	U2,.-1
	MOVE	U1,INDEXL	;Generate new file name
	PUSHJ	PDP,SIXADD
	MOVEM	U1,FILEI3
	MOVEM	U1,INDEXL
	MOVEM	U1,INDEXF(U2)	;Update the INDEX records
	PUSHJ	PDP,SIXOUT
	MOVE	U1,INDEXV
	MOVEM	U1,INDEXX(U2)
	MOVE	U1,INPA(U3)
	MOVEM	U1,INDEXA(U2)
	MOVE	U1,INPP(U3)
	MOVEM	U1,INDEXP(U2)
	MOVE	U1,INPK(U3)
	MOVEM	U1,INDEXK(U2)
	MOVE	U2,FILEIN
	PUSHJ	PDP,DMPDMP
	MOVE	U2,FILEI3
DMPFIZ:	PUSHJ	PDP,DMPDMP
	SETZM	FILCHG
	POPJ	PDP,